<?php

namespace App\Admin\Actions\Good;

use App\Admin\Services\GoodService;
use Encore\Admin\Actions\Action;
use Illuminate\Http\Request;

class SyncMws extends Action
{
    public $name = '同步amazon图片';

    protected $selector = '.sync-mws-post';

    public function handle(Request $request)
    {
        GoodService::syncMws();

        return $this->response()->success('正在更新中！')->refresh();
    }


    public function html()
    {
        return <<<HTML
        <a class="btn btn-sm btn-default sync-mws-post"><i class="fa fa-upload"></i>同步amazon图片</a>
HTML;
    }

}
